<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>PDF</title>
  <link rel="stylesheet" href="css/pdfh5.css" />
  <script src="js/pdf.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/pdf.worker.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/pdfh5.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
  html,
  body {
    height: 100%;
  }

  .pdf-h5 {
    width: 100%;
    height: 100%;
  }
</style>

<body>
  <div class="pdf-h5">
    <div id="pdf"></div>
  </div>
</body>

<script>
  function getQuery(params) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
      var pair = vars[i].split("=");
      if (pair[0] == params) return pair[1]
    }
    return false
  }
  document.title = decodeURIComponent(getQuery('title'));
  var height = getQuery('height');
  var cssheight = height ? 'calc(100% - ' + height + 'px)' : '100%';
  document.getElementById('pdf').style.height = cssheight;
  new Pdfh5("#pdf", {
    pdfurl: decodeURIComponent(getQuery('url')),
    lazy: true
  });
</script>

</html>